package oopday09;

public class GetSetText {
    public static void main(String[] args) {
        Point d1 = new Point();
        d1.setX(0);
        d1.setY(10);
        System.out.println(d1.getX()+" "+d1.getY());
        Point d2 = new Point();
        d2.setX(10);
        d2.setY(10);
        System.out.println(d2.getX()+" "+d2.getY());
    }
}

/**
 * 创建一个Point类 有x和y的私有属性
 */
class Point{
    private int x;
    private int y;

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }
}